// -------------------------------------------------------------
// Title:	HTMLog library
// Version:	0.80
// Description:	Simple class for printing logs in your programs.
//		Supporting printing to html and stdout.
// Dependences:	No
// File:	htmlog.h
// License:	GNU Library General Public License 2 (LGPL2)
// Authors:	Evgeny Bronnikov <bbroth@pochta.ru>
// -------------------------------------------------------------


#ifndef _HTMLOG_H_
#define _HTMLOG_H_

#define HTM_FILE    2   // write to file
#define HTM_STDOUT  4  // write to stdout
#define HTM_EMPTY   8 // no output

#define HTM_STYLE_BOLD      1
#define HTM_STYLE_ITALIC    2
#define HTM_STYLE_UNDERLINE 4

#define LogFile "log.html"

#include <stdio.h>

class HTMLog{
public:
 
  HTMLog();

// Specify log target, e.g. HTM_FILE
  HTMLog(int target);
  
 ~HTMLog(); 
 
// write plane text
 int Plain(char *message);
 
// write text with attributes (for HTM_FILE only)
 int Custom(char *message, int style, char* color);
 
// write info message
 int Info(char *message);
 
// write warning message 
 int Warning(char *message);
 
// write error message
 int Error(char *message);

private:

// set of internal stuff

 int log_target;
 FILE* fp;
 char *buffer;
 
 int html_init();
 
};


#endif //_HTMLOG_H_
